
package com.jf.cloud.seckill.controller.app;

import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.seckill.mapper.SeckillMapper;
import com.jf.cloud.seckill.model.SeckillCategory;
import com.jf.cloud.seckill.service.SeckillCategoryService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import ma.glasnost.orika.MapperFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 秒杀分类信息
 *
 * @author zz
 * @date 2021-04-19 11:26:35
 */
@RestController("appSeckillCategoryController")
@RequestMapping("/ua/seckill_category")
@Tag(name = "app-秒杀分类信息")
public class SeckillCategoryController {

    @Autowired
    private SeckillCategoryService seckillCategoryService;

    @Autowired
    private SeckillMapper seckillMapper;

    @Autowired
    private MapperFacade mapperFacade;

    @GetMapping("/list")
    @Operation(summary = "获取秒杀分类信息列表" , description = "分页获取秒杀分类信息列表")
    public ServerResponseEntity<List<SeckillCategory>> list() {
        List<SeckillCategory> seckillCategory = seckillCategoryService.list();
        return ServerResponseEntity.success(seckillCategory);
    }
}
